const conn = require('../data/lyd_backstage');
module.exports.lyd_backstage = (req, res) => {
    if (!req.session.isgaoyuan) {
        res.redirect('/gy_login');
        return;
    }
    res.render('lyd_backstage');
}
// 添加数据
module.exports.lyd_fromadd = (req, res) => {
    // console.log(req.body);
    let params = [req.body.type, req.body.start_time, req.body.stop_time, req.body.long_time, req.body.cause,'flase'];
    conn.query('insert into lyd_adduser values (null,?,?,?,?,?,?)',params,(error,results)=>{
        if(error) {
            return console.log(error);
        }
        // console.log(params);
        res.json({
            code:'1000', 
            message:'添加用户成功'
        })
    })
}
// 删除
